
/**
 *将文件转成base64
 *@param {File} file 文件内容
 *@returns {string} base64内容
 * */
function getBase64(file: File): Promise<any> {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = () => resolve(reader.result);
    reader.onerror = (error) => reject(error);
  });
}

export {
  getBase64
}